<template>
  <div class="clearfix table-out">
    <el-table
      :data="tableData"  empty-text=" "
      class="tablePub"
      :row-class-name="tableRowClassName"
    >
      <el-table-column prop="name" label="大赛名称" align="center">
        <template #default="scope">
          <p style="text-align: left; width: 100%">{{ scope.row.mingc }}</p>
        </template>
      </el-table-column>
      <el-table-column width="180"
        prop="dangqssjc_dictText"
        label="当前赛事进程"
        align="center"
      />
      <el-table-column width="180" prop="jincsm" label="进程说明" align="center" />
      <el-table-column prop="oper" label="操作" width="280" align="center">
        <template #default="scope">
          <el-button size="small" type="primary" @click="gotoZuoplb(scope.row)"
            >资料审核</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
    v-model:current-page="pageNo"
      v-model:page-size="pageSize"
      @current-change="handleCurrentChange"
      small
      background
      layout="total, prev, pager, next"
      :total="total"
      class="pagination fxr"
    />
  </div>
</template>

<script>
import axios from "axios";
import pubJs from "./pub";

export default {
  name: "homeList",
  mixins: [pubJs],
  data() {
    return {
      total: null,
      pageSize: 20,
      pageNo: 1,
    };
  },

  inject: ["imageUrl", "serviceUrl"],

  mounted() {
    this.getData();
  },
  methods: {
    getData(v) {
      let that = this;
      axios
        .get(that.serviceUrl + "/sais2/cdba2Sais/list", {
          headers: {
            "X-Access-Token": localStorage.getItem("token"),
          },
          params: {
            pageSize: this.pageSize,
            pageNo: this.pageNo,
            _t: new Date().getTime(),
          },
        })
        .then((resp) => {
          that.tableData = resp.data.result.records;
          this.total = resp.data.result.total;
          this.pageSize = resp.data.result.size;
        })
        .catch((error) => {
          //console.log(error);
        });
    },
    
    gotoZuoplb(row) {
      localStorage.setItem("formType", row.daim);
      localStorage.removeItem('searchFormData')
      
      this.$router.push({ path: "zilsh_list", query: { saisId: row.id } });
    },
  },
};
</script>

<style scoped lang="less">
.table-out {
  padding: 10px;
}
</style>
